import AirPlane from "./AirPlane.js";
import Pool from "./Pool.js";
import Vector2 from "./Vector2.js";
export default class Player extends AirPlane {
    constructor(x = 0, y = 0, width = 0, height = 0, imgPath = '') {
        super(x, y, width, height, imgPath);
        this.weapenPoints = new Array();
        this.shootReay = true;
        this.attackSpeed = 150;
        this.weapenPoints[0] = new Vector2(28, 8);
        this.weapenPoints[1] = new Vector2(84, 8);
    }
    shoot() {
        let bults = new Array();
        if (this.shootReay) {
            this.shootReay = false;
            setTimeout(() => {
                this.shootReay = true;
            }, this.attackSpeed);
            this.weapenPoints.forEach(e => {
                let x = this.x + e.x - 5;
                let y = this.y + e.y - 28;
                // let b = new SilverBullet(x,y)
                let b = Pool.generateBullet();
                b.x = x;
                b.y = y;
                bults.push(b);
            });
        }
        return bults;
    }
}
